<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function update(fn,elems)
{
    var data={};
    for(var i in elems)
        data[elems[i]]=$('#'+elems[i]).val();
    $.getJSON( fn, data, 
        function(r){ for(var i in r) $('#'+i).html(r[i]);} );
}
</script>
<p>
    dx=<input type="text" id="dx" value="1"/>;
    dy=<input type="text" id="dy" value="1"/>;
    phi=<input type="text" id="dphi" value="30"/>;
</p>
<button onclick="update('move',['dx','dy'])">move</button>
<button onclick="update('rotate',['dphi'])">rotate</button>
<p>
    x=<span id="x">-</span>
    y=<span id="y">-</span>
</p>